package com.shiyue.cqe.dao.impl;

import org.hibernate.Criteria;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;

import com.shiyue.cqe.bean.BaseTable;
import com.shiyue.cqe.dao.BaseTableRepository;

public class BaseTableDAO extends HibernateGenericDAO<BaseTable> implements
		BaseTableRepository {

	public BaseTableDAO(SessionFactory sessionFactory) {
		super(sessionFactory);
	}

	public BaseTable getByName(String name) {
		Criteria criteria = this.session().createCriteria(this.persistClass);
		criteria.add(Restrictions.eq("name", name));
		BaseTable table = (BaseTable) criteria.uniqueResult();
		return table;
	}


}
